<template>
  <h2>子级组件</h2>
  <h2>{{ phone }}</h2>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import axios from 'axios'

export default defineComponent({
  name: "AsyncComponent", //  异步组件
  async setup() {
    // return {
    //     msg: ref("what are you doing")
    // }
    
    // return new Promise((resolve, reject) => {
    //   setTimeout(() => {
    //     return resolve({ msg: "what are you doing ???" });
    //   }, 2000);
    // });

    // return axios.get('./data/address.json').then(res => res.data)
    return await axios.get('./data/address.json').then(res => res.data)
  },
});
</script>
